﻿/**********************************天使物流*******************************************
* 功能描述:系统设置——职位管理
* 作者:孟帅龙
* 时间:2022/1/8
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.System.Positions;
using Volo.Abp.Application.Services;

namespace TianShiProject.System.Positions
{
    public class PositionService : ApplicationService
    {
        private readonly IPositionRepository _positionRepository;
        public PositionService(IPositionRepository positionRepository)
        {
            _positionRepository = positionRepository;
        }

        #region 职位管理——查询分页显示
        /// <summary>
        /// 职位管理——查询分页显示
        /// </summary>
        /// <param name="DeptName"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<PositionDto>> GetPositionPageShow(string PositionName, int pageindex = 1, int pagesize = 3)
        {
            return await _positionRepository.GetPositionPageShow(PositionName, pageindex, pagesize);
        }
        #endregion

        #region 职位管理——逻辑删除
        /// <summary>
        /// 职位管理——逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<PageResponse<PositionDto>> DeleteDepartment(int id)
        {
            return await _positionRepository.DeleteDepartment(id);
        }
        #endregion

        #region 职位管理——批量删除
        /// <summary>
        /// 职位管理——批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task<PageResponse<PositionDto>> DeleteBatchDepartment(string ids)
        {
            return await _positionRepository.DeleteBatchDepartment(ids);
        }
        #endregion

        #region 职位管理——编辑
        /// <summary>
        /// 职位管理——编辑
        /// </summary>
        /// <param name="departmentDto"></param>
        /// <returns></returns>
        public async Task<int> PostUpdatePosition(PositionDto positionDto)
        {
            return await _positionRepository.PostUpdatePosition(positionDto);
        }
        #endregion

        #region 职位管理——添加
        /// <summary>
        /// 职位管理——添加
        /// </summary>
        /// <param name="rolesDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddPosition(PositionDto positionDto)
        {
            return await _positionRepository.PostAddPosition(positionDto);
        }
        #endregion

        #region 职位下拉框
        /// <summary>
        /// 职位下拉框
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<PositionDto>> GetPosition()
        {
            return await _positionRepository.GetPosition();
        }
        #endregion
    }
}
